#!/usr/bin/env bash


BUILD_VERSION=$(cat version)
BUILD_TIME=$(date "+%F %T")
COMMIT_SHA1=$(git rev-parse HEAD)

gox -osarch="darwin/amd64 linux/386 linux/amd64" \
  -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" \
  -tags="containers_image_openpgp" \
  -ldflags "-X main.BUILD_VERSION=$BUILD_VERSION -X 'main.BUILD_TIME=$BUILD_TIME' -X 'main.GO_VERSION=`go version`' -X 'main.COMMIT_SHA1=$COMMIT_SHA1' " \
  example.com/m/cmd1

#go build -ldflags "-X main.VERSION=1.0.0 -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'"